<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link href="/css/style.css" rel="stylesheet" type="text/css"/>
    <script charset="utf-8" src="/plugin/jquery/jquery-1.7.1.js"></script>
    <title>联想学院</title>
</head>
<body>
<div class="wapper">
    <div id="header">
        <img src="/images/index_banner_bg.gif"/>
    </div>
    <?php require_once("common/nav.php"); ?>
    <div id="subNav">
    </div>
    <div id="main">
        <div id="leftSideBar">
            <?php require_once("common/kuaijie.php"); ?>
        </div>
        <div id="rightContent">
            <div class="articleContent">
                <div class="meta">
                    <img src="/images/page_nav.gif"/>

                    <h1><?php echo $domain->name; ?></h1>
                    <span>作者:<?php echo $domain->author ?></span>
                    <span>发布时间:<?php echo $domain->create_time ?> 人气:<?php echo $domain->hits ?> </span>
                </div>

                <p><?php echo $domain->content ?></p>
            </div>
            <p style="text-align: right;"><em>文章来源:<?php echo $domain->source ?></em></p>

        </div>
    </div>
    <?php require_once("common/footer.php"); ?>
</div>
<script>
    $(function () {
        $("#nav").find("li").each(function () {
            $(this).bind("mouseover", function () {
                $(this).addClass("cur");
                var id = $(this).attr("name");
                $.ajax({
                    url:"/index.php/ajax/loadSubType/" + id,
                    dataType:"html",
                    async:false,
                    type:"GET",
                    beforeSend:function (jqXHR, settings) {
                        //这里显示进度条
                    },
                    error:function (jqXHR, textStatus, errorThrown) {

                    },
                    success:function (data, textStatus, jqXHR) {
                        data = eval("(" + data + ")");
                        if (data.length > 0) {
                            //如果有子分类
                            var hcodess = "";
                            $.each(data, function (n, j) {

                                hcodess = hcodess + '<li><a href="#">' + data[n].name + '</a></li>';
                            })
                            $("#subNav").html('<ul>' + hcodess + '</ul>');
                        } else {
                            $("#subNav").html("");
                        }
                    }});
                $(this).addClass("cur");
                $(this).siblings("li").removeClass("cur");
            })
        })
    })
</script>
</body>
</html>